{extend name="layout/main-block" /}

<!-- main content start -->
{block name="content"}
<section id="main-content">
    <section class="wrapper">
        <div class="row">
            <ol class="breadcrumb">
                <li class="h4"><a href="">人员管理</a></li>
            </ol>
        </div>
        <div class="row col-sm-1" style="margin-bottom: 20px;">
            <a href="{:url('people/people_create')}" class="btn btn-primary" role="button">添加人员</a>
        </div>
        <div class="row content-main">
            <div class="col-sm-12">
                <form action="">
                    <table class="table table-striped">
                        <tr>
                            <th>id</th>
                            <th>人员名称中文</th>
                            <th>人员名称英文</th>
                            {if condition="$jsId eq 1"}
                            <th class="depart">部门</th>
                            {/if}
                            {if condition="$jsId eq 2"}
                            <th class="team2" >格言中文</th>
                            <th class="team2" >格言英文</th>
                            {/if}
                            <th>小图片</th>
                            {if condition="$jsId neq 3"}
                            <th>大图片</th>
                            {/if}
                            <th>操作</th>
                        </tr>
                        {volist name="people" id="v" empty="$empty" }
                        <tr>
                            <td>{$v.people_id}</td>
                            <td>{$v.name_cn |mb_substr=0,8}</td>
                            <td>{$v.name_en |mb_substr=0,10}</td>

                            {if condition="$jsId eq 1"}
                            <td>{$v.depart_name |mb_substr=0,8}</td>
                            {/if}

                            {if condition="$jsId eq 2"}
                            <td>{$v.dictum_cn |mb_substr=0,8}</td>
                            <td>{$v.dictum_en |mb_substr=0,10}</td>
                            {/if}

                            <td>
                                {if condition="$v.s_img_url neq ''" }
                                <img src="{$v.s_img_url}" alt="" width="100">
                                {/if}
                            </td>
                            {if condition="$jsId neq 3"}
                            <td>
                                {if condition="$v.b_img_url neq ''" }
                                <img src="{$v.b_img_url}" alt="" width="100">
                                {/if}
                            </td>
                            {/if}
                            <td class="operation">
                                <a class="btn btn-info btn-xs" href="{:url('people/people_update', ['id'=>$v.people_id])}"><i class="glyphicon glyphicon-edit"></i>修改信息</a>
                                <!-- <a class="btn" href="{:url('department/department_enable', ['id'=>$v.department_id])}" value="">启用</a>-->
                                <a class="btn btn-danger btn-xs" href="{:url('people/people_delete', ['id'=>$v.people_id])}" onclick="return confirm('确定要删除吗？');"><i class="glyphicon glyphicon-remove"></i>删除人员</a>
                                {if condition="$jsId !=1"}
                                <a class="btn btn-success btn-xs" href="{:url('duty/index', ['id'=>$v.people_id])}"><i class="glyphicon glyphicon-hand-down"></i>查看职称</a>
                                {/if}
                                <a class="btn btn-primary btn-xs" href="{:url('people/people_intro', ['id'=>$v.people_id])}"><i class="glyphicon glyphicon-edit"></i>增改简介</a>
                                <a class="btn btn-warning btn-xs" href="{:url('people/people_intro_delete', ['id'=>$v.people_id])}" onclick="return confirm('确定要删除吗？');"><i class="glyphicon glyphicon-remove"></i>删除简介</a>
                            </td>
                        </tr>
                        {/volist}
                    </table>
                </form>
            </div>
        </div>
        {$page}
    </section>
</section>
{/block}

{block name="javascript"}
<script type="text/javascript">
     $(function(){
         //隐藏team需要的字段
        /* $(function () {
             var team = '{$jsId}';
             //console.log($(".newsneed"));
             if (team == 2) {
                // $(".team22").css("display", "block");//隐藏div
             }
             if(team != 1){
                 //$(".depart").css("display", "none");//隐藏div
             }
         });*/
     })
    /* $(function(){
    $oBtn = $(".btn");

    $oBtn.click(function(){
    if($oBtn.is("")){
    $oBtn.val("启用");
    }else{
    $oBtn.val("禁用");
    }
    })
    })*/
</script>
{/block}